<template>
  <div >
    <a-form-model class="fromModels" ref="privacyagreementModel" layout="vertical"  labelAlign="right"
    :labelCol="{span: 8}" :wrapperCol="{span: 8}">
        <a-form-model-item label="实名审核结果" >
          <a-radio-group v-model="smsystemFroms.real_verify.is_enable">
            <a-radio :value="1"> 支持 </a-radio>
            <a-radio :value="0"> 不支持 </a-radio>
          </a-radio-group>
        </a-form-model-item>
        <a-form-model-item label="审核通过" >
          <a-input type="textarea" v-model="smsystemFroms.real_verify.allow"></a-input>
        </a-form-model-item>
        <a-form-model-item label="审核驳回" >
          <a-input type="textarea" v-model="smsystemFroms.real_verify.disallow"></a-input>
        </a-form-model-item>

        <a-form-model-item label="计划取消结果" >
          <a-radio-group v-model="smsystemFroms.repayment_bad_going.is_enable">
            <a-radio :value="1"> 支持 </a-radio>
            <a-radio :value="0"> 不支持 </a-radio>
          </a-radio-group>
        </a-form-model-item>
        <a-form-model-item label="当天子计划成功的交易" >
          <a-input v-model="smsystemFroms.repayment_cancel.normal.content"></a-input>
          <div class="margins"></div>
          <a-input type="textarea" v-model="smsystemFroms.repayment_cancel.normal.mark"></a-input>
        </a-form-model-item>
        <a-form-model-item label="当天子计划余额不足的交易" >
          <a-input v-model="smsystemFroms.repayment_cancel.not_enough.content"></a-input>
          <div class="margins"></div>
          <a-input type="textarea" v-model="smsystemFroms.repayment_cancel.not_enough.mark"></a-input>
        </a-form-model-item>
        <a-form-model-item label="大计划未请求过一笔交易" >
          <a-input v-model="smsystemFroms.repayment_cancel.not_run.content"></a-input>
          <div class="margins"></div>
          <a-input type="textarea" v-model="smsystemFroms.repayment_cancel.not_run.mark"></a-input>
        </a-form-model-item>
        <a-form-model-item label="当天接收方账户超过有效期的交易" >
          <a-input v-model="smsystemFroms.repayment_cancel.expire.content"></a-input>
          <div class="margins"></div>
          <a-input type="textarea" v-model="smsystemFroms.repayment_cancel.expire.mark"></a-input>
        </a-form-model-item>
        <a-form-model-item label="大计划没有未执行订单（且已还小于计划金额）" >
          <a-input v-model="smsystemFroms.repayment_cancel.part_finish.content"></a-input>
          <div class="margins"></div>
          <a-input type="textarea" v-model="smsystemFroms.repayment_cancel.part_finish.mark"></a-input>
        </a-form-model-item>


        <a-form-model-item label="计划异常进行中" >
          <a-radio-group v-model="smsystemFroms.real_verify.is_enable">
            <a-radio :value="1"> 支持 </a-radio>
            <a-radio :value="0"> 不支持 </a-radio>
          </a-radio-group>
        </a-form-model-item>
        <a-form-model-item label="余额不足或者额度不足或金额不足" >
          <a-input v-model="smsystemFroms.repayment_bad_going.not_enough.content"></a-input>
          <div class="margins"></div>
          <a-input type="textarea" v-model="smsystemFroms.repayment_bad_going.not_enough.mark"></a-input>
        </a-form-model-item>



        <a-form-model-item  :wrapper-col="{ span: 21, offset:8 }">
          <a-button type="primary" @click="saveInfo">保存</a-button>
          <a-button style="margin: 0 10px;"  @click="resterInfor">重置</a-button>
          <a-button type="primary"  @click="saveInfo">同步品牌</a-button>
        </a-form-model-item>
    </a-form-model>
  </div>
</template>

<script>
import { getConfigCommon,writeConfigCommon } from '@/api/system.js'
export default {
  name: '',
  
  data() {
      return {
        smsystemFroms:{
          real_verify:{
            is_enable:0,
            disallow:'',
            allow:'',
          },
          repayment_bad_going:{
            is_enable:0,
            not_enough:{
              content:"",
              mark:"",
            }
          },
          repayment_cancel:{
            is_enable:0,
            not_enough:{
              content:"",
              mark:"",
              push_times:""
            },
            expire:{
              content:"",
              mark:"",
            },
            normal:{
              content:"",
              mark:"",
            },
            not_run:{
              content:"",
              mark:"",
            },
            part_finish:{
              content:"",
              mark:"",
            },
          }
        }
      }
  },
  created(){
    this.getDataInfor()
  },
  methods:{
    resterInfor(){
      this.smsystemFroms={
        real_verify:{
          is_enable:0,
          disallow:'',
          allow:'',
        },
        repayment_bad_going:{
          is_enable:0,
          not_enough:{
            content:"",
            mark:"",
          }
        },
        repayment_cancel:{
          is_enable:0,
          not_enough:{
            content:"",
            mark:"",
            push_times:""
          },
          expire:{
            content:"",
            mark:"",
          },
          normal:{
            content:"",
            mark:"",
          },
          not_run:{
            content:"",
            mark:"",
          },
          part_finish:{
            content:"",
            mark:"",
          },
        }
      }
    },
    saveInfo(){
      writeConfigCommon({
        brand_id: process.env.VUE_APP_BRAND_ID,scene:'sys_sms',...this.smsystemFroms}).then(res=>{
        this.$message.success("操作成功");
      })
    },

    getDataInfor(){
      getConfigCommon({
        brand_id: process.env.VUE_APP_BRAND_ID,scene:'sys_sms'}).then(res=>{
        this.smsystemFroms=res.data
      })
    }
  }
}
</script>

<style lang="less" scoped>
.margins{
  margin-bottom: 10px;
}
/deep/ .ant-form-vertical .ant-form-item-label{
  text-align: right;
  padding-right: 10px;
}
/deep/ .ant-form-vertical .ant-form-item-label::after{
  content: '：';
}
</style>
